import { DataTypes } from "sequelize";
import datasource from '../../framework/datasource'
import { Phrases, Word } from "../../word/dao/WorkDao";
const Warn = datasource.define('warn', {
    id: {
        type: DataTypes.INTEGER(),
        allowNull: false,
        primaryKey: true,
        autoIncrement: true,
    },
},{
    createdAt: "createTime",
    updatedAt: 'updateTime'
})
Word.hasMany(Warn, {
    foreignKey: 'wordId',
    onDelete: 'CASCADE',
})

Phrases.hasMany(Warn, {
    foreignKey: "phrasesId",
    onDelete: 'CASCADE',
})

export {
    Warn
}